Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly close requests Session object #118

Closed
wants to merge 2 commits into from
Closed

Conversation

ChipS3t
Copy link

@ChipS3t ChipS3t commented Oct 8, 2023

In the current implementation of the TodoistAPI class, self._session is not closed properly when its scope ends. Depending on how this library is used, it could lead to performance degradation or resource leaks. Consider allowing the class to be used in a context manager by defining __enter__ and __exit__ methods and creating a finalizer object property to clean up the Session object in the event of an exception or the program's end.

 - Cleans up self._session when object is garbage collected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants